using System.Collections.Generic;
using UnityEngine;

public class pointExitFromCar : MonoBehaviour
{
	public float radius = 0.7f;

	private List<Collider> _carColliders;

	public Vector3 point
	{
		get
		{
			Collider[] array = Physics.OverlapBox(base.transform.position, new Vector3(radius, radius, radius));
			Collider[] array2 = array;
			foreach (Collider collider in array2)
			{
				if (collider.tag != "MyVehicle" && !collider.isTrigger && collider.gameObject.layer != 4)
				{
					return Vector3.zero;
				}
			}
			return base.transform.position;
		}
	}

	public List<Collider> carColliders
	{
		get
		{
			if (_carColliders == null)
			{
				_carColliders = new List<Collider>(GetComponentInParent<EntityBehavior>().GetComponentsInChildren<Collider>());
			}
			return _carColliders;
		}
	}

	private void OnDrawGizmosSelected()
	{
		Gizmos.DrawCube(base.transform.position, new Vector3(2f * radius, 2f * radius, 2f * radius));
	}
}
